<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
<name>in.3</name>
<id>-1</id>
<cardCount>48</cardCount>
<cardID>9912</cardID>
<listID>21972</listID>
<cantModify><true /></cantModify>
<cantDelete><true /></cantDelete>
<cantAbort><false /></cantAbort>
<cardSize>
<width>512</width>
<height>342</height>
</cardSize>
<script>on openCardset the cursor to watchUpdateXCMDMenuset the cursor to handend opencardon openStackif the short name of this card is "start" then DoPictureAddMenuend openstackon closestackRemoveMenuend closestackon DoPicture-- this handler requires XCMD PictureShow and XFCN IsResourceglobal iSawThePictureif (iSawThePicture is empty) and ¬IsResource("PICT","Dartmouth Arms") thenshow card field "obscure buttons"put the visible of msg into msgVishide msglock screenPictureShow "Dartmouth Arms",165,82,1,"onPress"set the visible of msg to msgVisput "Indeed" into iSawThePicturehide card field "obscure buttons"unlock screen with dissolveelse hide card field "obscure buttons"end DoPictureon AddMenu-- this handler requires XCMD MenuHandlerglobal XCMDsMenuput "Index…,Search…,(-,Install…,(-,(Print Documentation…," into itemListput "(Print Source…,(-,(Save Source in File…" after itemListput itemList into XCMDsMenuMenuHandler "Add","XCMD's",itemListend AddMenuon RemoveMenu-- this handler requires XCMD MenuHandlerMenuHandler "Delete","XCMD's"end RemoveMenuon domenu anItemglobal XCMDsMenuif XCMDsMenu contains anItem thenDoXCMDs anItem -- see which item it is and do somethingelse -- is an enable HyperCard itempass domenu -- pass it on down the lineexit domenuend ifend domenuon DoXCMDs anItemif anItem is "Index…" thenDoIndexelse if anItem is "Search…" thenDoSearchelse if anItem is "Install…" thensend "Install" to this cardelse if anItem is "Print Documentation…" thenDoPrintDocelse if anItem is "Print Source…" thenDoPrintSourceelse if anItem is "Save Source in File…" thenDoSourceToFileend ifend DoXCMDson DoIndex-- this handler requires XFCN XScrollBoxglobal gLastIndexChoiceput SortField(card field "index" of card 1) into listif gLastIndexChoice is empty thenput 1 into gLastIndexChoiceend ifget XScrollBox(gLastIndexChoice,"Choose an XCMD:",list)go to this card -- update the windowif it is not empty thenset the cursor to watchput item 1 of it into gLastIndexChoicego card item 2 of itset the cursor to handend ifchoose browse toolend DoIndexon DoSearch-- this handler requires the following resources:-- DLOG "Find",DITL "Find",XFCN "ModalDialog"global findMode,whatToFindput whatToFind into line 4 of dialogInputif findMode is "whole" thenput "ON" into line 5 of dialogInputelse if findMode is "string" thenput "ON" into line 6 of dialogInputelse put "ON" into line 7 of dialogInputput ModalDialog("find",dialogInput,cardCenter) into dialogOutputif dialogOutput is "Cancel" then exit DoSearchput line 4 of dialogOutput into whatToFindif line 5 of dialogOutput is "ON" thenput "whole" into findModeelse if line 6 of dialogOutput is "ON" thenput "string" into findModeelse put empty into findModeput "find" && findMode && quote & whatToFind & quote into commanddo commandend DoSearchon DoPrintDoc-- this handler requires XCMD PrintField and XFCN ObjectExistsif ObjectExists("card field Documentation") thenPrintField "card field Documentation",1else if ObjectExists("field Documentation") thenPrintField "field Documentation",1,36,36,36,36end ifend DoPrintDocon DoPrintSource-- this handler requires XCMD PrintField and XFCN ObjectExistsif ObjectExists("card field source") thenPrintField "card field source",1,36,36,36,36end ifif ObjectExists("card field source1") thenPrintField "card field source1",1,36,36,36,36if the result is "Cancel" then exit DoPrintSourceend ifif ObjectExists("card field source2") thenPrintField "card field source2",1,36,36,36,36end ifend DoPrintSourceon ShowError theErroranswer "Sorry, an error occurred. (" & theError & ")"end ShowErroron DoSourceToFile-- this handler requires XCMD WriteToFile and XFCN ObjectExistsput the short name of this card into fileNameif the short name of this background is "Roger's" thenput ".c" after fileNameput "KAHL" into creatorelse if the short name of this background is "Kevin's" thenput ".p" after fileNameput "MPS " into creatorend ifif ObjectExists("card field source") thenWriteToFile card field "Source",FALSE,fileName,FALSE,creatorput the result into theResultif word 1 of theResult is "Error" then ShowErrorend if-- the sources to MenuHandler and ModalDialog are in two parts,-- therefore the following:if ObjectExists("card field source1") and ¬ObjectExists("card field source2") thenWriteToFile card field "Source1",FALSE,fileName,FALSE,creatorput the result into theResultif theResult is "Cancel" then exit DoSourceToFileif word 1 of theResult is "Error" thendelete word 1 of theResultShowError theResultexit DoSourceToFileend ifWriteToFile card field "Source2",TRUE,theResult,TRUEend ifend DoSourceToFileon UpdateXCMDMenu-- this handler requires XCMD MenuHandler and XFCN ObjectExistsif ObjectExists("card field Documentation") or¬ObjectExists("field Documentation")thenMenuHandler "Enable","XCMD's","Print Documentation…"elseMenuHandler "Disable","XCMD's","Print Documentation…"end ifif ObjectExists("card field source") or¬ObjectExists("card field source1") or¬ObjectExists("card field source2")thenMenuHandler "Enable","XCMD's","Print Source…"MenuHandler "Enable","XCMD's","Save Source in File…"elseMenuHandler "Disable","XCMD's","Print Source…"MenuHandler "Disable","XCMD's","Save Source in File…"end ifif Offset("Install",the script of this card) > 0¬then MenuHandler "Enable","XCMD's","Install…"else MenuHandler "Disable","XCMD's","Install…"end UpdateXCMDMenufunction ResInStack resType,resName,resID,stackNameglobal resInfolock screenpush cardgo to stack stackNameput the long name of this stack into stackPathnamedelete word 1 of stackPathnamedelete char 1 of stackPathnamedelete last char of stackPathNameput IsResource(resType,resName,resID,TRUE) into resExistspop cardunlock screenif resExists is FALSE then return FALSEelse return (item 5 of resInfo is stackPathname)end ResInStackon InstallResource resType,resName,targetStackglobal resInfoset cursor to watchif not IsResource(resType,resName) THENanswer resType && quote & resName & quote && "does not exist."exit InstallResourceend ifput item 3 of resInfo into resIDput the long name of this stack into thisStackdelete first word of thisStackdelete first char of thisStackdelete last char of thisStackif targetStack is thisStack then exit InstallResourceset lockMessages to TRUElock screenpush cardgo stack targetStackif ResInStack(resType,resName,empty,targetStack) thenanswer "Replace" && resType && quote & resName & quote & "?"¬with "OK" or "Cancel"if it is "Cancel" thenpop cardunlock screenset lockMessages to FALSEexit InstallResourceend ifend ifif ResInStack(resType,empty,resID,targetStack) thenif item 2 of resInfo is not resName thenanswer "Replace" && resType && resID & "?"¬with "OK" or "Cancel"if it is "Cancel" thenpop cardunlock screenset lockMessages to FALSEexit InstallResourceend ifend ifend ifpop cardRInstall resType,resName,targetStackget the resultif it is not empty then answer itunlock screenset lockMessages to FALSEend InstallResourcefunction ChooseTargetStackset lockMessages to TRUElock screenpush cardput the short name of this card into resNameif LENGTH(resName) > 14 then put "resource" into resNamego stack "target stack for" && resNameput the long name of this stack into targetStackdelete first word of targetStackdelete first char of targetStackdelete last char of targetStackpop cardunlock screenset lockMessages to FALSEreturn targetStackend ChooseTargetStack